<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\service\DesEncrypt;
use app\service\FXApiService;
use app\service\IyunBinkService;
use think\facade\Queue;
/**
 * 首页接口.
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页.
     */
    public function index()
    {
        $obClassName = 'app\job\test';
        // 2.当任务归属的队列名称，如果为新队列，会自动创建
        $FxLoginQueueName = "";
        $FxLoginQueueName2 = "";
        // 3.当前任务所需业务数据，不能为resource类型，其他类型最终将转化为json形式的字符串
        $jobData = ['ts' => time(),'name'=>1111];
        $jobData2= ['ts' => time(),'name'=>2222];
        // 4.将该任务推送到消息列表，等待对应的消费者去执行
        // 入队列，later延迟执行，单位秒，push立即执行
        Queue::later(10, $obClassName, $jobData, $FxLoginQueueName);
        Queue::later(10, $obClassName, $jobData2, $FxLoginQueueName2);
        $this->success('请求成功');
    }
    public function text(){
        // var_dump(111);
        $data=IyunBinkService::querySpreadRate('C4IpdxcTbdEpNR6zBBlXr1');
        return json_encode($data) ;
    }
    public function yxtext(){
        // var_dump(111);
        $data=FXApiService::queryProductCommissons('1527126667559088128');
        return json_encode($data) ;
    }
    public function list(){
        $dec=new DesEncrypt('21,76,33,17,84,34,56,34');
        $data=$dec->decrypt('Gd7Yf/P8YImiqs9Fl2aokTLN35+VBQZHPHxd+YqpuEJJ7RWpv+wOECTeUY572AqhF5nDhv3BjhmF
        cJvkXrNrBULgQsXPCYMHaaxCS1fh0Js=');
        return json_encode($data) ;
    }
    public function Iyuntext(){
        // var_dump(111);
        $data=FXApiService::regist('18922313319','1','Mm123456');
        return json_encode($data) ;
    }
}
